
package nccloud.web.arap.manual.action;

import java.util.Map;

import nc.vo.arap.manualcost.AggManualCostVO;
import nc.vo.pubapp.pattern.model.entity.bill.AbstractBill;
import nccloud.web.arap.manual.action.base.BaseScriptAction;
import nccloud.web.arap.manual.utils.ResultUtil;
import nccloud.pubitf.riart.pflow.CloudPFlowContext;
import nc.bs.framework.common.NCLocator;
import nccloud.pubitf.mmbd.commit.service.IBatchRunScript;
import nccloud.dto.mmbd.script.entity.BDScriptResultDTO;

/**
* @description 提交Action
* @ref
**/
public class CommitAction extends BaseScriptAction {

    @Override
    public Map<String, Object> processSuccessResult(AbstractBill[] bills, AbstractBill[] orginalBills) {
    return ResultUtil.getResult(bills, orginalBills);
    }

    @Override
    public BDScriptResultDTO execScript(AbstractBill[] aggNccloudVOs) {
        CloudPFlowContext context = new CloudPFlowContext();
        context.setActionName("SAVE");
        context.setBillType("RGCB");
        context.setBillVos(aggNccloudVOs);
        BDScriptResultDTO result = ((IBatchRunScript) NCLocator.getInstance().lookup(IBatchRunScript.class)).runBacth(context, AggManualCostVO.class);
        return result;
    }

    @Override
    public Class<AggManualCostVO> getClazz() {
        return AggManualCostVO.class;
    }

}
